#pragma once
#include <string>
#include <list>
using namespace std;

class Observer;

class fabuzzhe {
public:
	//添加订阅者
	void attach(Observer* obj);
	//删除订阅者
	void detach(Observer* obj);
	//通知订阅者
	virtual void notify(string msg) = 0;
	virtual ~fabuzzhe(){}
protected:
	list<Observer*> m_list;
};

class fabuzhe1 : public fabuzzhe {
public:
	void notify(string msg) override;
};

class fabuzhe2 : public fabuzzhe {
public:
	void notify(string msg) override;
};
